//
//  YYT_LoginTableViewCell.m
//  AudioVisualFeast
//
//  Created by 温晓宇 on 16/1/29.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "QL_LoginTableViewCell.h"

@interface QL_LoginTableViewCell ()

@property (nonatomic, strong)UIButton *logOutButton;

@end

@implementation QL_LoginTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create{
    BmobUser *bUser = [BmobUser getCurrentUser];
    self.userLabel = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 - 50, 50, 100, 30)];
    _userLabel.text = bUser.username;
    _userLabel.textColor = WHITE_COLOR;
//    _userLabel.backgroundColor = WHITE_COLOR;
    [self.contentView addSubview:_userLabel];
    
    self.logOutButton = [UIButton buttonWithType:UIButtonTypeCustom];
//    _logOutButton.backgroundColor = WHITE_COLOR;
    _logOutButton.frame = CGRectMake(WIDTH / 3 + 70, 50, 50, 30);
    [_logOutButton setTitle:@"注销" forState:UIControlStateNormal];
    [_logOutButton addTarget:self action:@selector(logOutButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_logOutButton];
    
}
- (void)logOutButton:(UIButton *)btn{
    [self.delegate logOut];
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
